 /* 
 * File:   cLateralPlayer.h
 * Author: josep
 *
 * Created on 24 / desembre / 2010, 01:00
 */

#ifndef CLATERALPLAYER_H
#define	CLATERALPLAYER_H

#include "cLateralAgent.h"
#include "cAgentCollisionEvent.h"


class cLateralPlayer: public cLateralAgent {
public:
    enum Estado {LEFT=0, RIGHT, MOVING_LEFT, MOVING_RIGHT, JUMPING_LEFT, JUMPING_RIGHT, DEATH};
    enum Transition {STOP=0, TO_LEFT, TO_RIGHT, JUMP, STOP_JUMP, DIE, REVIVE};
    cLateralPlayer();
    cLateralPlayer(const cLateralPlayer& orig);
    virtual ~cLateralPlayer();
    void prepareJump();
    int GetMaxJumpForce() const;
    int GetJumpForce() const;
    virtual void Init(cTexture *texture, int PosX=0, int PosY=0, int Width=0,
                                int Height=0);
    virtual bool isDead();
    virtual void NextStep(int time);

    void revive();
    void setLives(int lives);
    int getLives() const;
    void setItemCounter(int ind, int ItemCounter);
    int getItemCounter(int ind) const;
    void setEnemies(int enemies);
    int getEnemies() const;
    bool isWinner();
    void setSuper(bool super);
    bool isSuper() const;

protected:
    virtual int ChangeFramestate(int, int, int);
    virtual bool NotifyAgentCollision(cAgentCollisionEvent *revent);
    virtual void Notify(cPhysicalReaction *revent);
private:
    int MaxJumpForce;
    int JumpForce;
    void SetMaxJumpForce(int MaxJumpForce);
    void Init();
    int lives;
    int enemies;
    int ItemCounter[MAX_ITEM_INDEX];
    bool Winner;
    bool super;
};

#endif	/* CLATERALPLAYER_H */

